package com.foreknow.mapping;

import com.foreknow.model.GuestBook;

import java.sql.ResultSet;
import java.sql.SQLException;

public class GuestBookMapping implements EntityMapping {
    @Override
    public Object mapping(ResultSet rs) throws SQLException {
        GuestBook guestBook = new GuestBook();
        guestBook.setId(rs.getInt("id"));
        guestBook.setName(rs.getString("name"));
        guestBook.setPhone(rs.getString("phone"));
        guestBook.setEmail(rs.getString("email"));
        guestBook.setTitle(rs.getString("title"));
        guestBook.setContent(rs.getString("content"));
        guestBook.setCreatedTime(rs.getString("createdTime"));
        return guestBook;
    }
}
